<?php
/*
	监听电商客下单事件
*/
defined('BY_JYA') or exit('error');
$order=$event;
if($this->setting['become_child']==2 || true){
	//首次下单成为下线，团队长暂无下线
	$mid=$order['mid'];
	$member=$this->get('member',array('mid'=>$mid),array('mid','fromuser','is_agent'));
	if(!$member['fromuser']){
		$fromuser=pdo_getcolumn('core_members',array('id'=>$mid),'fromuser');
		if($fromuser){
			$this->model('member')->set_parent($mid,$fromuser);
		}
	}
	
}
